package org.ysh.core.utils;

import org.apache.shiro.crypto.hash.SimpleHash;

public class Md5Utils {

    // Java 实现MD5加密
    public static String md5(String str) {
        // 1. 先将字符串转换成字节数组
        byte[] bytes = str.getBytes();
        // 2. 定义一个字符串缓冲区
        StringBuffer sb = new StringBuffer();
        // 3. 遍历字节数组
        return str;
    }

    public static void main(String[] args) {
        SimpleHash hash = new SimpleHash("MD5", "admin123456", "ysh".toCharArray());
        System.out.println(hash.toHex());
    }

}
